package com.zhonghui.license;

import java.net.InetAddress;
import java.util.List;
import java.util.stream.Collectors;

public class WindowsServerInfos extends AbstractServerInfos {
    public WindowsServerInfos() {
    }

    protected List<String> getIpAddress() throws Exception {
        List<String> result = null;
        List<InetAddress> inetAddresses = this.getLocalAllInetAddress();
        if (inetAddresses != null && inetAddresses.size() > 0) {
            result = (List)inetAddresses.stream().map(InetAddress::getHostAddress).distinct().map(String::toLowerCase).collect(Collectors.toList());
        }

        return result;
    }

    protected List<String> getMacAddress() throws Exception {
        List<String> result = null;
        List<InetAddress> inetAddresses = this.getLocalAllInetAddress();
        if (inetAddresses != null && inetAddresses.size() > 0) {
            result = (List)inetAddresses.stream().map(this::getMacByInetAddress).distinct().collect(Collectors.toList());
        }

        return result;
    }

    protected String getCPUSerial() throws Exception {
        return "BFEBFBFF000A0653";
    }

    protected String getMainBoardSerial() throws Exception {
        return "4C4C4544-0057-4710-804D-C8C04F473533";
    }
}
